package com.whfc.openapi.api.energy.controller;

import com.whfc.common.result.Result;
import com.whfc.common.result.ResultUtil;
import com.whfc.openapi.api.energy.service.OpenEnergyService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 */
@RestController
@RequestMapping("open/api/v1/energy")
public class EnergySwznController {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private OpenEnergyService openEnergyService;

    @PostMapping(value = "/anon/swzn/receiveData")
    public Result receiveSwznData(@RequestBody String body) {
        logger.info("接收所为智能上报数据:{}", body);
        openEnergyService.receiveSwznData(body);
        return ResultUtil.success();
    }
}
